def geocode(key,address,city=None)->str:
    """获取高得API的地理编码
    注释：key是高德API的密钥，请先去注册
          address是结构化地址，具体请查看：https://lbs.amap.com/api/webservice/guide/api/georegeo
    """
    
    url = "https://restapi.amap.com/v3/geocode/geo?parameters"
    params = {
        "key":key,
        "address":address,
        "city":city
    }
    response = requests.get(url,params)
    results = response.json()[ 'geocodes'][0][ 'location']
    # 返回值
    return results

